﻿Public Class receiptTransaction
    Dim item As ListViewItem
    Sub listdata()
        If Not rs.EOF Then
            ListView1.Items.Clear()
            rs.MoveFirst()
            Do While Not rs.EOF
                item = ListView1.Items.Add(rs.Fields("productcode").Value)
                item.SubItems.Add(rs.Fields("quantity").Value)
                item.SubItems.Add(rs.Fields("description").Value)
                item.SubItems.Add("Php " + FormatNumber(rs.Fields("sellingprice").Value, 2, True, True, True))
                item.SubItems.Add("Php " + FormatNumber(rs.Fields("Lineprice").Value, 2, True, True, True))
                rs.MoveNext()

            Loop
        Else
            ListView1.Items.Clear()

        End If
        rs.Close()
        rs = Nothing

    End Sub
    Private Sub receiptTransaction_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Module1.connect()
        Button1.Enabled = True
        Button3.Enabled = False
        Button9.Enabled = False
        Button12.Enabled = False
        PictureBox1.Visible = False
        PictureBox2.Visible = False
        Button6.Hide()
        Label16.Visible = False

        rs = New ADODB.Recordset
        rs.Open("SELECT TOP 1 * from receipts order by receiptno desc", cn, 3, 2)
        If Not rs.EOF Then
            
            TextBox9.Text = rs.Fields("SalesTax").Value
        End If
        rs.Close()
        rs = Nothing


        CheckBox1.Checked = False
        TextBox9.Enabled = False
        TextBox10.Text = Date.Today
        TextBox7.Hide()
        TextBox4.Enabled = False
        Button2.Enabled = False
        Button3.Enabled = False
        Button4.Enabled = False
        Button5.Enabled = False
        Button6.Enabled = False
        Button11.Enabled = False
        TextBox5.Enabled = False
        TextBox6.Enabled = False
        TextBox4.Enabled = False
        TextBox8.Enabled = False
        TextBox1.Enabled = False
        TextBox2.Enabled = False
        TextBox3.Enabled = False
        TextBox10.Enabled = False
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Button10.Enabled = False

        If TextBox4.Text = "" Then
            MsgBox("Please Supply 'Customer No.' Field")
        Else
            rs = New ADODB.Recordset
            rs.Open("SELECT * from customers where customerno = " & TextBox4.Text & "", cn, 3, 2)
            If Not rs.EOF Then
                TextBox1.Text = rs.Fields("name1").Value
                TextBox2.Text = rs.Fields("address").Value
                TextBox3.Text = rs.Fields("city").Value
            End If
            rs.Close()
            rs = Nothing


            rs = New ADODB.Recordset
            rs.Open("select * FROM receipts", cn, 3, 2)
            rs.AddNew()
            rs.Fields("date1").Value = Date.Today
            rs.Fields("Customerno").Value = TextBox4.Text
            rs.Fields("SalesTax").Value = TextBox9.Text
            rs.Update()
            rs.Close()
            rs = Nothing

            Button1.Enabled = False
            Button2.Enabled = True
            Button9.Enabled = True
            Button4.Enabled = False
            Button5.Enabled = True
            Button6.Enabled = False
            Button11.Enabled = False
            TextBox5.Enabled = True
            TextBox5.Text = "1"
            Button7.Enabled = False
            CheckBox1.Checked = False
            CheckBox1.Enabled = False
            CheckBox1.Enabled = False




            rs = New ADODB.Recordset
            rs.Open("select max(receiptno) as e FROM receipts", cn, 3, 2)

            If Not rs.EOF Then
                TextBox8.Text = rs.Fields("e").Value
            End If
            rs.Close()
            rs = Nothing

            viewCustomers.Close()
        End If

    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        rs = New ADODB.Recordset
        rs.Open("select max(receiptno) as e FROM receipts", cn, 3, 2)
        Dim receiptnum As Integer
        If Not rs.EOF Then
            receiptnum = rs.Fields("e").Value
        End If
        rs.Close()
        rs = Nothing

        rs = New ADODB.Recordset
        rs.Open("SELECT * from customers where customerno = " & TextBox4.Text & "", cn, 3, 2)
        If Not rs.EOF Then
            TextBox1.Text = rs.Fields("name1").Value
            TextBox2.Text = rs.Fields("address").Value
            TextBox3.Text = rs.Fields("city").Value
        End If
        rs.Close()
        rs = Nothing

        rs = New ADODB.Recordset
        rs.Open("SELECT * from receipts where receiptno = " & receiptnum & "", cn, 3, 2)
        rs.Fields("date1").Value = Date.Today
        rs.Fields("Customerno").Value = TextBox4.Text
        rs.Update()
        rs.Close()
        rs = Nothing

        viewCustomers.Close()



        
    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        If TextBox6.Text = "" Or TextBox5.Text = "" Then
            MsgBox("Supply 'Quantity' or 'Product Code' Fields")
        Else
            If Not IsNumeric(TextBox5.Text) Then
                MsgBox("Supply Number in 'Quantity' Field")
            Else
                rs = New ADODB.Recordset
                rs.Open("select max(receiptno) as e FROM receipts", cn, 3, 2)
                Dim receiptnum1 As Integer
                If Not rs.EOF Then
                    receiptnum1 = rs.Fields("e").Value
                End If
                rs.Close()
                rs = Nothing

                rs = New ADODB.Recordset
                rs.Open("SELECT count(ProductCode)  as e from ReceiptProducts where receiptno = " & receiptnum1 & "", cn, 3, 2)
                Dim count As Integer
                If Not rs.EOF Then
                    count = rs.Fields("e").Value
                End If
                rs.Close()
                rs = Nothing

                If count > 6 Then
                    MsgBox("It should be only 7 types of product per transaction")
                Else

                    rs = New ADODB.Recordset
                    rs.Open("select max(receiptno) as e FROM receipts", cn, 3, 2)
                    Dim receiptnum As Integer
                    If Not rs.EOF Then
                        receiptnum = rs.Fields("e").Value
                    End If
                    rs.Close()
                    rs = Nothing

                    rs = New ADODB.Recordset
                    rs.Open("select * FROM receiptproducts where productcode = '" & TextBox6.Text & "' and ReceiptNo = " & receiptnum & "", cn, 3, 2)
                    If Not rs.EOF Then
                        MsgBox("This product has already been added")
                    Else

                        rs = New ADODB.Recordset
                        rs.Open("select unitprice FROM products where productcode = '" & TextBox6.Text & "'", cn, 3, 2)
                        Dim sellingprce As Double
                        If Not rs.EOF Then
                            sellingprce = rs.Fields("unitprice").Value
                        End If
                        rs.Close()
                        rs = Nothing

                        rs = New ADODB.Recordset
                        rs.Open("select * FROM receiptproducts", cn, 3, 2)
                        rs.AddNew()
                        rs.Fields("receiptno").Value = receiptnum
                        rs.Fields("productcode").Value = TextBox6.Text
                        rs.Fields("quantity").Value = TextBox5.Text
                        rs.Fields("sellingprice").Value = sellingprce
                        rs.Update()
                        rs.Close()
                        rs = Nothing

                        Button6.Enabled = True

                        TextBox5.Text = "1"
                        TextBox6.Text = ""

                        rs = New ADODB.Recordset
                        rs.Open("SELECT quantity, productcode, description, sellingprice, (quantity*sellingprice) AS Lineprice FROM Query5 WHERE receiptno = " & receiptnum & "", cn, 3, 2)
                        Me.listdata()

                        rs = New ADODB.Recordset
                        rs.Open("SELECT SUM(quantity*sellingprice) AS total FROM Query5 WHERE receiptno = " & receiptnum & "", cn, 3, 2)
                        Dim total123 As Double
                        If Not rs.EOF And Not rs.Fields("total").Value Is DBNull.Value Then
                            total123 = rs.Fields("total").Value
                        Else
                            total123 = "0"
                        End If
                        rs.Close()
                        rs = Nothing
                        Label11.Text = "Php " + FormatNumber(total123, 2, True, True, True)
                        Label14.Text = "Php " + FormatNumber((total123 / (1 + (TextBox9.Text / 100))), 2, True, True, True)
                        Label15.Text = "Php " + FormatNumber(total123 - (total123 / (1 + (TextBox9.Text / 100))), 2, True, True, True)

                    End If
                End If
            End If
        End If
    End Sub

    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click

        If TextBox5.Text = "" Or TextBox6.Text = "" Then
            MsgBox("There is no product to remove")
        Else
            rs = New ADODB.Recordset
            rs.Open("select max(receiptno) as e FROM receipts", cn, 3, 2)
            Dim receiptnum As Integer
            If Not rs.EOF Then
                receiptnum = rs.Fields("e").Value
            End If
            rs.Close()
            rs = Nothing


            rs = New ADODB.Recordset
            rs.Open("select * FROM receiptproducts where receiptno = " & receiptnum & " AND productcode = '" & TextBox6.Text & "' AND quantity = " & TextBox5.Text & "", cn, 3, 2)
            rs.Delete()
            rs.Close()
            rs = Nothing


            rs = New ADODB.Recordset
            rs.Open("SELECT quantity, productcode, description, sellingprice, (quantity*sellingprice) AS Lineprice FROM Query5 WHERE receiptno = " & receiptnum & "", cn, 3, 2)
            Me.listdata()

            rs = New ADODB.Recordset
            rs.Open("SELECT SUM(quantity*sellingprice) AS total FROM Query5 WHERE receiptno = " & receiptnum & "", cn, 3, 2)
            Dim total123 As Double
            If Not rs.EOF And Not rs.Fields("total").Value Is DBNull.Value Then
                total123 = rs.Fields("total").Value
            Else
                total123 = "0"
            End If
            rs.Close()
            rs = Nothing
            Label11.Text = "Php " + FormatNumber(total123, 2, True, True, True)
            Label14.Text = "Php " + FormatNumber(total123 / (1 + (TextBox9.Text / 100)), 2, True, True, True)
            Label15.Text = "Php " + FormatNumber(total123 - (total123 / (1 + (TextBox9.Text / 100))), 2, True, True, True)

          

            TextBox5.Text = "1"
            TextBox6.Text = ""
        End If
    End Sub

    Private Sub ListView1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListView1.SelectedIndexChanged
        Button3.Enabled = False
        TextBox6.Text = ListView1.FocusedItem.Text
        Button4.Enabled = True
        TextBox5.Enabled = False
    End Sub


    Private Sub TextBox6_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox6.TextChanged
     

        rs = New ADODB.Recordset
        rs.Open("select max(receiptno) as e FROM receipts", cn, 3, 2)
        Dim receiptnum As Integer
        If Not rs.EOF Then
            receiptnum = rs.Fields("e").Value
        End If
        rs.Close()
        rs = Nothing

        rs = New ADODB.Recordset
        rs.Open("select productcode,quantity, description, sellingprice, (quantity*sellingprice) AS Lineprice FROM Query5 WHERE productcode = '" & TextBox6.Text & "' AND receiptno = " & receiptnum & " ", cn, 3, 2)
        If Not rs.EOF Then
            TextBox6.Text = rs.Fields("productcode").Value
            TextBox5.Text = rs.Fields("quantity").Value

        End If
        rs.Close()
    End Sub

    Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
        Dim intResponse As MsgBoxResult
        intResponse = MsgBox("Are you sure you want to cancel order?", MsgBoxStyle.YesNo, "Confirm")
        If intResponse = MsgBoxResult.Yes Then

        rs = New ADODB.Recordset
        rs.Open("select max(receiptno) as e FROM receipts", cn, 3, 2)
        Dim receiptnum As Integer
        If Not rs.EOF Then
            receiptnum = rs.Fields("e").Value
        End If
        rs.Close()
        rs = Nothing

        rs = New ADODB.Recordset
        rs.Open("select * FROM receipts where receiptno = " & receiptnum & "", cn, 3, 2)
        rs.Delete()
        rs.Close()
        rs = Nothing

        TextBox7.Hide()
            Button1.Enabled = True
            Button9.Enabled = False
            Button10.Enabled = True
            Button2.Enabled = False
        Button3.Enabled = False
        Button4.Enabled = False
        Button5.Enabled = False
            Button6.Enabled = False
            Button11.Enabled = False
        Button7.Enabled = True
        TextBox5.Enabled = False
        TextBox6.Enabled = False
        TextBox4.Text = ""
        TextBox1.Text = ""
        TextBox2.Text = ""
        TextBox3.Text = ""
        TextBox8.Text = ""
        TextBox5.Text = ""
        TextBox6.Text = ""
            Label11.Text = "Php " + FormatNumber("0", 2, True, True, True)
            Label14.Text = "Php " + FormatNumber("0", 2, True, True, True)
            Label15.Text = "Php " + FormatNumber("0", 2, True, True, True)
            CheckBox1.Enabled = True
            TextBox9.Enabled = False

            ListView1.Items.Clear()
            viewCustomers.Close()
            viewproducts1.Close()

        End If

    End Sub

   
    Private Sub PrintDocument1_PrintPage(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs)

    End Sub

    Private Sub PrintDocument1_PrintPage_1(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs)

    End Sub

    Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
       
        viewCustomers.Close()
        viewproducts1.Close()

        Label16.Visible = True
        TextBox9.Visible = True
        Label13.Visible = True


        Button1.Hide()
        Button2.Hide()
        Button3.Hide()
        Button4.Hide()
        Button5.Hide()
        Button6.Hide()
        Button7.Hide()
        Button8.Hide()
        Button9.Hide()
        Button10.Visible = False
        Button12.Visible = False
        PictureBox1.Visible = True
        Label6.Hide()
        Label7.Hide()
        TextBox5.Hide()
        TextBox6.Hide()
       
        CheckBox1.Visible = False
       

        On Error GoTo errorfound

        PrintForm1.Print()

        TextBox7.Hide()

        Button1.Visible = True
        Button2.Visible = True
        Button3.Visible = True
        Button4.Visible = True
        Button5.Visible = True
        Button6.Visible = True
        Button7.Visible = True
        Button8.Visible = True
        Button9.Visible = True
        Label6.Visible = True
        Label7.Visible = True
        TextBox5.Visible = True
        TextBox6.Visible = True
        Button10.Visible = True
        Button12.Visible = True


        Button1.Enabled = True
        Button2.Enabled = False
        Button3.Enabled = False
        Button4.Enabled = False
        Button5.Enabled = False
        Button6.Enabled = False
        Button6.Hide()
        Button11.Show()
        Button7.Enabled = True
        Button8.Enabled = True
        Button9.Enabled = False
        Button10.Enabled = True
        Button12.Enabled = False
        TextBox5.Enabled = False
        TextBox6.Enabled = False
        TextBox4.Text = ""
        TextBox4.Enabled = False
        TextBox6.Enabled = False
        TextBox1.Text = ""
        TextBox2.Text = ""
        TextBox3.Text = ""
        TextBox8.Text = ""
        TextBox5.Text = "1"
        TextBox6.Text = ""
        Label11.Text = "Php " + FormatNumber("0", 2, True, True, True)
        Label14.Text = "Php " + FormatNumber("0", 2, True, True, True)
        Label15.Text = "Php " + FormatNumber("0", 2, True, True, True)
        CheckBox1.Enabled = True
        CheckBox1.Visible = True
        CheckBox1.Checked = False
        TextBox9.Visible = True
        TextBox9.Enabled = False
        Label13.Visible = True
        Label16.Visible = False

        rs = New ADODB.Recordset
        rs.Open("SELECT TOP 1 * from receipts order by receiptno desc", cn, 3, 2)
        If Not rs.EOF Then

            TextBox9.Text = rs.Fields("SalesTax").Value
        End If
        rs.Close()
        rs = Nothing

        PictureBox1.Visible = False
        PictureBox2.Visible = False
        Me.BackColor = Color.FromKnownColor(KnownColor.Control)
        ListView1.BackColor = Color.White
        TextBox4.BackColor = Color.FromKnownColor(KnownColor.Control)
        TextBox1.BackColor = Color.FromKnownColor(KnownColor.Control)
        TextBox2.BackColor = Color.FromKnownColor(KnownColor.Control)
        TextBox3.BackColor = Color.FromKnownColor(KnownColor.Control)
        TextBox8.BackColor = Color.FromKnownColor(KnownColor.Control)
        TextBox10.BackColor = Color.FromKnownColor(KnownColor.Control)
        TextBox9.BackColor = Color.FromKnownColor(KnownColor.Control)
        TextBox10.Text = Date.Today
        ListView1.Items.Clear()
        ListView1.Enabled = True
        Button11.Enabled = False

        Exit Sub

errorfound: MsgBox("Error on Printing")
        Resume Next


    End Sub

    Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click
        MainScreen.Show()
        viewCustomers.Close()
        viewproducts1.Close()
        viewearnings1.Close()
        Me.Close()
    End Sub

    Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click
        viewCustomers.show()

    End Sub

    Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button9.Click
        viewproducts1.Show()

    End Sub

    Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
   
    End Sub

    
    Private Sub Button10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
        TextBox7.Focus()
    End Sub

    Private Sub Label11_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label11.Click

    End Sub

    Private Sub Button10_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs)

    End Sub

    Private Sub Button11_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button11.Click
        rs = New ADODB.Recordset
        rs.Open("select max(receiptno) as e FROM receipts", cn, 3, 2)
        Dim receiptnum As Integer
        If Not rs.EOF Then
            receiptnum = rs.Fields("e").Value
        End If
        rs.Close()
        rs = Nothing

        rs = New ADODB.Recordset
        rs.Open("SELECT count(ProductCode)  as e from ReceiptProducts where receiptno = " & receiptnum & "", cn, 3, 2)
        Dim count As Integer
        If Not rs.EOF Then
            count = rs.Fields("e").Value
        End If
        rs.Close()
        rs = Nothing

        If count = 0 Then
            MsgBox("There is no product in the order list")
        Else
            Dim intResponse As MsgBoxResult
            intResponse = MsgBox("Are you sure that you are done?", MsgBoxStyle.YesNo, "Confirm")
            If intResponse = MsgBoxResult.Yes Then
                MsgBox("You can now PRINT the receipt")
                Me.BackColor = Color.White

                TextBox4.BackColor = Color.White
                TextBox1.BackColor = Color.White
                TextBox2.BackColor = Color.White
                TextBox3.BackColor = Color.White
                TextBox8.BackColor = Color.White
                TextBox10.BackColor = Color.White
                TextBox9.BackColor = Color.White

                ListView1.Enabled = False


                ListView1.BackColor = Color.White

                PictureBox1.Visible = True
                PictureBox2.Visible = True
                Button1.Visible = False
                Button2.Visible = False
                Button3.Visible = False
                Button4.Visible = False
                Button5.Visible = False
                Button7.Visible = False
                Button8.Visible = False
                Button9.Visible = False
                Label6.Visible = False
                Label7.Visible = False
                TextBox5.Visible = False
                TextBox6.Visible = False
                Button10.Visible = False
                Button12.Visible = False
                Button11.Hide()
                Button6.Show()
                Button6.Enabled = True
                viewCustomers.Close()
                viewproducts1.Close()


            End If
        End If


     

       

    End Sub

    Private Sub CheckBox1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
        If CheckBox1.Checked Then
            TextBox9.Enabled = True
        Else
            TextBox9.Enabled = False
        End If
    End Sub

    Private Sub TextBox9_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox9.TextChanged
        If TextBox9.Text = "" Or Not IsNumeric(TextBox9.Text) Then
            MsgBox("This field should be numeric")

            rs = New ADODB.Recordset
            rs.Open("SELECT TOP 1 * from receipts order by receiptno desc", cn, 3, 2)
            If Not rs.EOF Then

                TextBox9.Text = rs.Fields("SalesTax").Value
            End If
            rs.Close()
            rs = Nothing

        End If
    End Sub

    Private Sub CheckBox1_CheckedChanged_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged
        If CheckBox1.Checked = True Then
            TextBox9.Enabled = True
        Else
            TextBox9.Enabled = False
        End If
    End Sub

    Private Sub PictureBox1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox1.Click

    End Sub

    Private Sub Button10_Click_2(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button10.Click
        viewearnings1.Show()
        viewCustomers.Close()

        Button8.Enabled = False
        Button9.Enabled = False
        Button1.Enabled = False
        Button11.Enabled = False
        CheckBox1.Enabled = False
        TextBox9.Enabled = False
        ListView1.Enabled = False


    End Sub

    Private Sub TextBox8_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox8.TextChanged
        
    End Sub

    Private Sub Button12_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button12.Click
        viewearnings1.Button1.Enabled = True

        Module1.connect()
        rs = New ADODB.Recordset
        rs.Open("SELECT * from query7 where receiptno = " & TextBox8.Text & "", cn, 3, 2)
        If Not rs.EOF Then
            TextBox4.Text = rs.Fields("customerno").Value
            TextBox1.Text = rs.Fields("name1").Value
            TextBox2.Text = rs.Fields("address").Value
            TextBox3.Text = rs.Fields("city").Value
            TextBox10.Text = rs.Fields("date1").Value
            TextBox9.Text = rs.Fields("SalesTax").Value
        End If
        rs.Close()
        rs = Nothing

        rs = New ADODB.Recordset
        rs.Open("SELECT quantity, productcode, description, sellingprice, (quantity*sellingprice) AS Lineprice FROM Query7 WHERE receiptno = " & TextBox8.Text & "", cn, 3, 2)
        Me.listdata()

        rs = New ADODB.Recordset
        rs.Open("SELECT SUM(quantity*sellingprice) AS total FROM Query5 WHERE receiptno = " & TextBox8.Text & "", cn, 3, 2)
        Dim total123 As Double
        If Not rs.EOF And Not rs.Fields("total").Value Is DBNull.Value Then
            total123 = rs.Fields("total").Value
        Else
            total123 = "0"
        End If
        rs.Close()
        rs = Nothing
        Label11.Text = "Php " + FormatNumber(total123, 2, True, True, True)
        Label14.Text = "Php " + FormatNumber(total123 / (1 + (TextBox9.Text / 100)), 2, True, True, True)
        Label15.Text = "Php " + FormatNumber(total123 - (total123 / (1 + (TextBox9.Text / 100))), 2, True, True, True)

    End Sub

    Private Sub TextBox7_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox7.TextChanged

    End Sub

    Private Sub receiptTransaction_FormClosing(ByVal sender As System.Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles MyBase.FormClosing

    End Sub
End Class